#include <bits/stdc++.h>
using namespace std;
int n,m,a[1000005],b[1000005],T;
int main()
{
    freopen("arena.in","r",stdin);
    freopen("arena.out","w",stdout);
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++) scanf("%d",a+i);
    for(int i=1;i<=m;i++) scanf("%d",b+i);
    scanf("%d",&T);
    while(T--) printf("1\n");
    return 0;
}
